// src/stores/routeStore.ts
import { defineStore } from 'pinia'
//import { markRaw } from 'vue'
//import { House, Avatar, Document, Tickets, Setting, Clock, Lock } from '@element-plus/icons-vue'

// 定义菜单项的类型
export interface MenuItem {
  index: string;
  title: string;
  // 修改 icon 类型为字符串，用于存储图标名称
  icon?: string;
  path?: string;
  children?: MenuItem[];
  disabled?: boolean;
}

// 定义菜单列表的类型
export interface menuList {
  menuList: MenuItem[]
}

export const useSysMenuStore = defineStore('sysMenu', {
  state: (): menuList => ({
    menuList: [
      {
        index: '1',
        title: '工作台',
        icon: "House",
        children: [
          { index: '1-1', title: '首页', icon: "Document"  },
          { index: '1-2', title: '待办理任务', icon: "Document" },
          { index: '1-3', title: '已办理任务', icon: "Document" },
          { index: '1-4', title: '我的任务', icon: "Document"  },
          { index: '1-5', title: '我的计划', icon: "Document"  },
        ],
      },
      {
        index: '2',
        title: '基础资料',
        icon: "Document",
        children: [
          { index: '2-1', title: '车间资料', icon: "Document"  },
          { index: '2-2', title: '仓库资料', icon: "Document"  },
          { index: '2-3', title: '品牌资料', icon: "Document"  },
          { index: '2-4', title: '单位资料', icon: "Document"  },
          { index: '2-5', title: '供应商资料', icon: "Document"  },
          { index: '2-6', title: '客户资料', icon: "Document"  },

        ],
      },
      {
        index: '3',
        title: '货品管理',
        icon: "Tickets",
        children: [
          { index: '3-1', title: '货品类别', icon: "Document"  },
          { index: '3-2', title: '货品资料', icon: "Document"  },
          { index: '3-3', title: '货品库存', icon: "Document"  },
          { index: '3-4', title: '货品库存查询', icon: "Document"  },
          { index: '3-5', title: '货品库存调整', icon: "Document"  },
          { index: '3-6', title: '货品库存调整查询', icon: "Document"  },

        ],
      },
      {
        index: '4',
        title: '订单管理',
        icon: "Clock",
        children: [
          { index: '4-1', title: '订单录入', icon: "Document"  },
          { index: '4-2', title: '订单查询', icon: "Document"  },
          { index: '4-3', title: '订单打印', icon: "Document"  },
          { index: '4-4', title: '订单取消', icon: "Document"  },


        ],
      },
      {
        index: '5',
        title: '计划管理',
        icon: "Tickets",
        children: [
          { index: '5-1', title: '计划排单', icon: "Document"  },
          { index: '5-2', title: '工单录入', icon: "Document"  },
          { index: '5-3', title: '工单查询', icon: "Document"  },
          { index: '5-4', title: '工单打印', icon: "Document"  },
          { index: '5-5', title: '工单取消', icon: "Document"  },
          { index: '5-6', title: '工单修改', icon: "Document"  },


        ],
      },
      {
        index: '6',
        title: '生产管理',
        icon: "Clock",
        children: [
          { index: '6-1', title: '报工扫描', icon: "Document"  },
          { index: '6-2', title: '不良品扫描', icon: "Document"  },
          { index: '6-3', title: '返修品扫描', icon: "Document"  },
          { index: '6-4', title: '换码扫描', icon: "Document"  },
          { index: '6-5', title: '包装扫描', icon: "Document"  },
          { index: '6-6', title: '库存查询', icon: "Document"  },
          { index: '6-7', title: '报工报表', icon: "Document"  },
          { index: '6-8', title: '生产报表', icon: "Document"  },

        ],
      },
      {
        index: '7',
        title: '物料管理',
        icon: "Clock",
        children: [
          { index: '7-1', title: '入库单', icon: "Document"  },
          { index: '7-2', title: '移交单', icon: "Document"  },
          { index: '7-3', title: '出货单', icon: "Document"  },
          { index: '7-4', title: '盘点单', icon: "Document"  },
          { index: '7-5', title: '调整单', icon: "Document"  },
          { index: '7-6', title: '库存查询', icon: "Document"  },
          { index: '7-7', title: '库存报表', icon: "Document"  },
          { index: '7-8', title: '物料报表', icon: "Document"  },

        ],
      },
      {
        index: '8',
        title: '用户与权限',
        icon: "Setting",
        children: [
          { index: '8-1', title: '用户列表', icon: "Document"  },
          { index: '8-2', title: '角色列表', icon: "Document"  },
          { index: '8-3', title: '用户角色', icon: "Document"  },
          { index: '8-4', title: '模块列表', icon: "Document"  },
          { index: '8-5', title: '权限列表', icon: "Document"  },
          { index: '8-6', title: '角色授权', icon: "Document"  },
          { index: '8-7', title: '注册', icon: "Document"  },
          { index: '8-8', title: '登录', icon: "Document"  },
          { index: '8-9', title: '修改密码', icon: "Lock" },
        ],
      },
      {
        index: '9',
        title: '系统设置',
        icon: "Setting",
        children: [
          { index: '9-1', title: '系统参数', icon: "Avatar"  },
          { index: '9-2', title: '页面菜单', icon: "Document"  },
          { index: '9-3', title: '操作日志', icon: "Document"  },
          { index: '9-4', title: '数据字典', icon: "Document"  },
          { index: '9-5', title: '数据字典项', icon: "Document"  },
          { index: '9-6', title: '数据字典项值', icon: "Document"  },
        ],
      },
    ],
  }),
})